# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=maui
pkgname=communicator
pkgver=4.0.0
pkgrel=0
pkgdesc="Contacts and dialer application"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://invent.kde.org/maui/communicator"
license="GPL-3.0-or-later"
depends="
	mauikit-filebrowsing
	mauikit-texteditor
	"
makedepends="
	extra-cmake-modules
	kcontacts-dev
	kcoreaddons-dev
	ki18n-dev
	kpeople-dev
	kservice-dev
	mauikit-dev
	mauikit-filebrowsing-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	samurai
	"
_repo_url="https://invent.kde.org/maui/communicator.git"
source="https://download.kde.org/stable/maui/communicator/$pkgver/maui-communicator-$pkgver.tar.xz
	0001-$pkgname-Fix-build.patch::https://invent.kde.org/maui/maui-communicator/-/merge_requests/4.patch
	"
subpackages="$pkgname-lang"
options="!check" # No tests
builddir="$srcdir/maui-$pkgname-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
a49acb89e4f5fa910f0a09521493cbadfc7a0ff757d46cbb075ea2cd8f5bd762be5a9fe665ef4f75a2702e5d49decf4b0139743840311f767c6a6a4fd314e84f  maui-communicator-4.0.0.tar.xz
9bb84cc5c254790f45ddb28fe9e3a54fd780d03f42c2c207828e94c6814cfcace0945d5b9f52259d3defe9ef91ddb085c064584ab8f954fb705073626c037abc  0001-communicator-Fix-build.patch
"
